package com.vanke.devops.domain.enums;

import com.vanke.core.exception.VankeBusinessException;

/**
 * @author 陈景阳
 * @since 2018/5/11
 */
public enum  UsersErrorCode implements ErrorCode{
    USER_NOT_FOUND("0001","找不到对应的用户"),
    USER_LOGIN_FAIL("0002","用户登录失败")
    ;

    private String code;
    private String message;

    UsersErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return ErrorCode.getErrorCodePrefix(UsersErrorCode.class) + code;
    }
    @Override
    public String getMessage() {
        return message;
    }

    public VankeBusinessException getException(){
        return new VankeBusinessException(this.getCode(), this.getMessage());
    }
}
